package com.gao.service;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.gao.entity.Order;
import com.gao.exception.OrderException;

import java.util.List;

/**
 * @author gao
 * @time 2022/11/25 11:27:20
 */
public interface OrderService {
    /**
     * 注意，在添加订单的同时，会扣减商品库存
     *
     * @throws OrderException
     */
    void addOrder(Integer productId, Integer quantity);

    /**
     * 注意，在添加订单的同时，会扣减商品库存
     *
     * @throws OrderException
     */
    void addOrder(List<Integer> productIds, List<Integer> quantities);

    /**
     * @param orderId
     * @return
     */
    @SentinelResource
    Order getOrderDetailByOrderId(Integer orderId);
}
